<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box"></div>
    
    <script>
        // ES6 proxy 代理对象
        var obj={}
        var vm = new Proxy(obj,{
            get(obj,key){
                console.log('get')
                return obj[key]
            },
            set(obj,key,value){
                console.log('set')
                obj[key] = value
                box.innerHTML = value
            }
        })
    </script>
</body>
</html>